.class public abstract Lde/dealdoktor/app/activities/SuperListing;
.super Landroid/app/Activity;
.source "SuperListing.java"


# instance fields
.field bookmarkModel:Lde/dealdoktor/app/db/BaseModel;

.field protected isLoading:Z

.field protected listAdapter:Lde/dealdoktor/app/adapter/PostListAdapter;

.field protected loadingView:Landroid/view/View;

.field protected results:Landroid/widget/ListView;

.field public tabs:Lde/dealdoktor/app/activities/Tabs;


# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    .line 22
    invoke-direct {p0}, Landroid/app/Activity;-><init>()V

    .line 25
    const/4 v0, 0x0

    iput-boolean v0, p0, Lde/dealdoktor/app/activities/SuperListing;->isLoading:Z

    .line 22
    return-void
.end method


# virtual methods
.method protected go(I)V
    .locals 5
    .parameter "position"

    .prologue
    .line 86
    iget-object v3, p0, Lde/dealdoktor/app/activities/SuperListing;->listAdapter:Lde/dealdoktor/app/adapter/PostListAdapter;

    iget-object v3, v3, Lde/dealdoktor/app/adapter/PostListAdapter;->postList:Ljava/util/ArrayList;

    sput-object v3, Lde/dealdoktor/app/App;->posts:Ljava/util/ArrayList;

    .line 88
    sget-object v3, Lde/dealdoktor/app/App;->posts:Ljava/util/ArrayList;

    if-eqz v3, :cond_0

    sget-object v3, Lde/dealdoktor/app/App;->posts:Ljava/util/ArrayList;

    invoke-virtual {v3}, Ljava/util/ArrayList;->size()I

    move-result v3

    if-le v3, p1, :cond_0

    .line 89
    new-instance v0, Landroid/content/Intent;

    invoke-virtual {p0}, Lde/dealdoktor/app/activities/SuperListing;->getParent()Landroid/app/Activity;

    move-result-object v3

    const-class v4, Lde/dealdoktor/app/activities/Details;

    invoke-direct {v0, v3, v4}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 90
    .local v0, details:Landroid/content/Intent;
    const-string v3, "postId"

    invoke-virtual {v0, v3, p1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;I)Landroid/content/Intent;

    .line 91
    invoke-virtual {p0}, Lde/dealdoktor/app/activities/SuperListing;->getParent()Landroid/app/Activity;

    move-result-object v1

    check-cast v1, Lde/dealdoktor/app/activities/TabGroupActivity;

    .line 92
    .local v1, parentActivity:Lde/dealdoktor/app/activities/TabGroupActivity;
    new-instance v2, Ljava/util/Random;

    invoke-direct {v2}, Ljava/util/Random;-><init>()V

    .line 93
    .local v2, rand:Ljava/util/Random;
    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "Details"

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const v4, 0xf4240

    invoke-virtual {v2, v4}, Ljava/util/Random;->nextInt(I)I

    move-result v4

    invoke-static {v4}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v1, v3, v0}, Lde/dealdoktor/app/activities/TabGroupActivity;->startChildActivity(Ljava/lang/String;Landroid/content/Intent;)V

    .line 95
    .end local v0           #details:Landroid/content/Intent;
    .end local v1           #parentActivity:Lde/dealdoktor/app/activities/TabGroupActivity;
    .end local v2           #rand:Ljava/util/Random;
    :cond_0
    return-void
.end method

.method protected onCreate(Landroid/os/Bundle;)V
    .locals 3
    .parameter "savedInstanceState"

    .prologue
    .line 32
    invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V

    .line 33
    new-instance v1, Lde/dealdoktor/app/db/BaseModel;

    const-string v2, "bookmarks"

    invoke-direct {v1, p0, v2}, Lde/dealdoktor/app/db/BaseModel;-><init>(Landroid/content/Context;Ljava/lang/String;)V

    iput-object v1, p0, Lde/dealdoktor/app/activities/SuperListing;->bookmarkModel:Lde/dealdoktor/app/db/BaseModel;

    .line 34
    const-string v1, "layout_inflater"

    invoke-virtual {p0, v1}, Lde/dealdoktor/app/activities/SuperListing;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/view/LayoutInflater;

    .line 35
    .local v0, infl:Landroid/view/LayoutInflater;
    const v1, 0x7f030012

    const/4 v2, 0x0

    invoke-virtual {v0, v1, v2}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v1

    iput-object v1, p0, Lde/dealdoktor/app/activities/SuperListing;->loadingView:Landroid/view/View;

    .line 36
    return-void
.end method

.method protected onPause()V
    .locals 0

    .prologue
    .line 53
    invoke-super {p0}, Landroid/app/Activity;->onPause()V

    .line 55
    return-void
.end method

.method protected onResume()V
    .locals 0

    .prologue
    .line 47
    invoke-super {p0}, Landroid/app/Activity;->onResume()V

    .line 49
    return-void
.end method

.method public onSearchRequested()Z
    .locals 1

    .prologue
    .line 99
    invoke-virtual {p0}, Lde/dealdoktor/app/activities/SuperListing;->getParent()Landroid/app/Activity;

    move-result-object v0

    invoke-virtual {v0}, Landroid/app/Activity;->onSearchRequested()Z

    move-result v0

    return v0
.end method

.method public onSearchRequestedSuper()Z
    .locals 1

    .prologue
    .line 103
    invoke-super {p0}, Landroid/app/Activity;->onSearchRequested()Z

    move-result v0

    return v0
.end method

.method public toggleBookmarkStatus(ILandroid/widget/ImageView;)V
    .locals 6
    .parameter "id"
    .parameter "view"

    .prologue
    const/4 v5, 0x0

    .line 63
    iget-object v2, p0, Lde/dealdoktor/app/activities/SuperListing;->bookmarkModel:Lde/dealdoktor/app/db/BaseModel;

    const-string v3, "id"

    invoke-static {p1}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v2, v3, v4}, Lde/dealdoktor/app/db/BaseModel;->getBy(Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v0

    .line 64
    .local v0, c:Landroid/database/Cursor;
    invoke-interface {v0}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v2

    if-eqz v2, :cond_0

    .line 66
    iget-object v2, p0, Lde/dealdoktor/app/activities/SuperListing;->bookmarkModel:Lde/dealdoktor/app/db/BaseModel;

    const-string v3, "id"

    invoke-static {p1}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v2, v3, v4}, Lde/dealdoktor/app/db/BaseModel;->deleteBy(Ljava/lang/String;Ljava/lang/String;)V

    .line 67
    const v2, 0x7f020027

    invoke-virtual {p2, v2}, Landroid/widget/ImageView;->setImageResource(I)V

    .line 68
    const-string v2, "von den Top-Deals entfernt"

    invoke-static {p0, v2, v5}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;

    move-result-object v2

    invoke-virtual {v2}, Landroid/widget/Toast;->show()V

    .line 77
    :goto_0
    invoke-interface {v0}, Landroid/database/Cursor;->close()V

    .line 78
    return-void

    .line 71
    :cond_0
    new-instance v1, Ljava/util/HashMap;

    invoke-direct {v1}, Ljava/util/HashMap;-><init>()V

    .line 72
    .local v1, m:Ljava/util/HashMap;,"Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/String;>;"
    const-string v2, "id"

    invoke-static {p1}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v1, v2, v3}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 73
    iget-object v2, p0, Lde/dealdoktor/app/activities/SuperListing;->bookmarkModel:Lde/dealdoktor/app/db/BaseModel;

    invoke-virtual {v2, v1}, Lde/dealdoktor/app/db/BaseModel;->replace(Ljava/util/HashMap;)Z

    .line 74
    const v2, 0x7f020026

    invoke-virtual {p2, v2}, Landroid/widget/ImageView;->setImageResource(I)V

    .line 75
    const-string v2, "als Top-Deal gespeichert"

    invoke-static {p0, v2, v5}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;

    move-result-object v2

    invoke-virtual {v2}, Landroid/widget/Toast;->show()V

    goto :goto_0
.end method
